<template>
  <a-modal
    title="播放"
    :width="800"
    :visible="visible"
    :centered="true"
    :confirmLoading="confirmLoading"
    @ok="handleSubmit"
    @cancel="handleCancel"
    footer="">
    <a-row :gutter="24">
      <div style="text-align: center">
        <audio :src="fileUrl" controls="controls"></audio>
      </div>
    </a-row>
  </a-modal>
</template>

<script>

import { sysFileInfoDetail } from '@/api/modular/system/fileManage'

export default {
  name: 'PlayIndex',
  data () {
    return {
      fileUrl: '',
      visible: false,
      confirmLoading: false,
      url: window.CONST.VUE_APP_API_BASE_FILE_URL
    }
  },
  created () {
  },
  methods: {
    play (record) {
      this.visible = true
      sysFileInfoDetail({ id: record.fileId }).then(res => {
        if (res.success) {
          this.fileUrl = this.url + res.data.fileBucket + '/' + res.data.fileOriginName
        }
      })
    },
    handleSubmit () {
      this.visible = false
    },
    pause () {
      this.visible = true
      this.fileName = ''
    },
    handleCancel () {
      this.pause()
      this.visible = false
    }

  }
}
</script>

<style lang="less">
.table-operator {
  margin-bottom: 18px;
}
button {
  margin-right: 8px;
}
</style>
